/**
 * Author: Dmitry Ustimov
 * Date: 5/11/13
 * Time: 5:12 PM
 */

package com.gmail.dmitryustimov.ms.java7.composite.classic.example;

public class Demo {

    public static void main(String[] args) {
        //Initialize four ellipses
        Ellipse ellipse1 = new Ellipse("E1");
        Ellipse ellipse2 = new Ellipse("E2");
        Ellipse ellipse3 = new Ellipse("E3");
        Ellipse ellipse4 = new Ellipse("E4");

        //Initialize three composite graphics
        CompositeGraphic graphic = new CompositeGraphic("CG");
        CompositeGraphic graphic1 = new CompositeGraphic("CG1");
        CompositeGraphic graphic2 = new CompositeGraphic("CG2");

        //Composes the graphics
        graphic1.add(ellipse1);
        graphic1.add(ellipse2);
        graphic1.add(ellipse3);

        graphic2.add(ellipse4);

        graphic.add(graphic1);
        graphic.add(graphic2);

        //Prints the complete graphic (four times the string "Ellipse").
        graphic.print();
    }
}
